package com.example.demo.responseBodyAdvice.demo5.db.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.example.demo.responseBodyAdvice.demo5.util.EncryptField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

/**
 * @author zjq
 * @version 创建时间：2021-12-17 15:24:52
 */
@ContentRowHeight(20) // 设置 Cell 高度 为10
@HeadRowHeight(20)   //  设置表头 高度 为 20
@ColumnWidth(15)    //   列宽25
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "学生敏感信息测试表")
@Entity
@Table(name = "student")
public class Student {

    @ExcelIgnore // 这个字段不会生成
    @Column(name = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ExcelProperty("学生姓名")
    @ApiModelProperty(value = "学生姓名")
    @Column(name = "name")
    private String name;

    @ExcelProperty("性别")
    @ApiModelProperty(value = "性别")
    @Column(name = "sex")
    private String sex;

    @ExcelProperty("身份证")
    @EncryptField
    @ApiModelProperty(value = "身份证")
    @Column(name = "idcard")
    private String idcard;

    @ExcelProperty("身份证2")
    @EncryptField
    @ApiModelProperty(value = "身份证2(模仿不同字段相同内容)")
    @Column(name = "sfzjh")
    private String sfzjh;

    @ExcelProperty("学号")
    @EncryptField
    @ApiModelProperty(value = "学号")
    @Column(name = "xh")
    private String xh;

    @ExcelProperty("年龄")
    @ApiModelProperty(value = "年龄")
    @Column(name = "age")
    private String age;

    @Transient
    @ExcelProperty("错误信息")
    @ApiModelProperty(value = "错误信息")
    private String errorMsg;


}
